#ifndef _HCC_ERROR_CODE_DRV_IDP_SPI_H_
#define _HCC_ERROR_CODE_DRV_IDP_SPI_H_

#include "ofc_types.h"
#include "hcc_error_code.h"
#include "hcc_error_code_drv.h"

#ifdef __cplusplus
extern "C" {
#endif

// 不含行号的错误码生成
#define HCC_MAKE_DRV_IDP_SPI_ERROR(error_code) (int)HCC_MAKE_DRIVER_ERROR(kHccDrvIdpSpi, error_code, HCC_ERROR_LEVEL_ERROR)
// 含行号的错误码生成
#define HCC_MAKE_DRV_IDP_SPI_ERROR_LINE(error_code) (int)HCC_ERROR(HCC_MAKE_DRIVER_ERROR(kHccDrvIdpSpi, error_code, HCC_ERROR_LEVEL_ERROR))


/**
 * IO模拟SPI驱动:IO模拟SPI驱动
 */
enum THccDrvIdpSpiTag
{
	kHccDrvIdpSpiSuccess	=	HCC_ERROR_SUCCESS,			///< 成功,没有错误
	kHccDrvIdpSpiFailed	=	HCC_MAKE_DRV_IDP_SPI_ERROR(0),			///<失败
	kHccDrvIdpSpiParam	=	HCC_MAKE_DRV_IDP_SPI_ERROR(1),			///<参数错误
	kHccDrvIdpSpiOpened	=	HCC_MAKE_DRV_IDP_SPI_ERROR(2),			///<已打开
	kHccDrvIdpSpiClosed	=	HCC_MAKE_DRV_IDP_SPI_ERROR(3),			///<已关闭
	kHccDrvIdpSpiPort	=	HCC_MAKE_DRV_IDP_SPI_ERROR(4),			///<端口错误
	kHccDrvIdpSpiCallBack	=	HCC_MAKE_DRV_IDP_SPI_ERROR(5),			///<回调函数未设置
	kHccDrvIdpSpiBusy	=	HCC_MAKE_DRV_IDP_SPI_ERROR(6),			///<总线忙
	kHccDrvIdpSpiRange	=	HCC_MAKE_DRV_IDP_SPI_ERROR(7),			///<读写的数据尺寸超过 IDP_SPI_FRAME_MAX_SIZE
};
typedef enum THccDrvIdpSpiTag THccDrvIdpSpi;


typedef Int32 THccDrvIdpSpiLine;
#define kHccDrvIdpSpiSuccessLine	HCC_ERROR_SUCCESS	///< 成功,没有错误
#define kHccDrvIdpSpiFailedLine	HCC_MAKE_DRV_IDP_SPI_ERROR_LINE(0)	///<失败
#define kHccDrvIdpSpiParamLine	HCC_MAKE_DRV_IDP_SPI_ERROR_LINE(1)	///<参数错误
#define kHccDrvIdpSpiOpenedLine	HCC_MAKE_DRV_IDP_SPI_ERROR_LINE(2)	///<已打开
#define kHccDrvIdpSpiClosedLine	HCC_MAKE_DRV_IDP_SPI_ERROR_LINE(3)	///<已关闭
#define kHccDrvIdpSpiPortLine	HCC_MAKE_DRV_IDP_SPI_ERROR_LINE(4)	///<端口错误
#define kHccDrvIdpSpiCallBackLine	HCC_MAKE_DRV_IDP_SPI_ERROR_LINE(5)	///<回调函数未设置
#define kHccDrvIdpSpiBusyLine	HCC_MAKE_DRV_IDP_SPI_ERROR_LINE(6)	///<总线忙
#define kHccDrvIdpSpiRangeLine	HCC_MAKE_DRV_IDP_SPI_ERROR_LINE(7)	///<读写的数据尺寸超过 IDP_SPI_FRAME_MAX_SIZE

//旧版本适配补丁
typedef THccDrvIdpSpi TIdpSpiErrorCode;

#define kIdpSpiErrorCodeSuccess kHccDrvIdpSpiSuccess
#define kIdpSpiErrorCodeFailed kHccDrvIdpSpiFailed
#define kIdpSpiErrorCodeParam kHccDrvIdpSpiParam
#define kIdpSpiErrorCodeOpened kHccDrvIdpSpiOpened
#define kIdpSpiErrorCodeClosed kHccDrvIdpSpiClosed
#define kIdpSpiErrorCodePort kHccDrvIdpSpiPort
#define kIdpSpiErrorCodeCallBack kHccDrvIdpSpiCallBack
#define kIdpSpiErrorCodeBusy kHccDrvIdpSpiBusy
#define kIdpSpiErrorCodeRange kHccDrvIdpSpiRange

#ifdef __cplusplus
}  // extern "C"
#endif

#endif // _HCC_ERROR_CODE_DRV_IDP_SPI_H_
/**
 * @
 */
